<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:api')->get('/user', function (Request $request) {
    return $request->user();
});

//会员端
Route::group(['namespace'=>'UserApi','prefix' => 'user'],function (){
    Route::get('class_home_lists', 'ClassController@class_home');
});



//会员登录
Route::post('login','UserApi\LoginController@login');

Route::post('wx_login','UserApi\LoginController@wx_login');

Route::post('banner_list','UserApi\IndexController@banner_list');

Route::group(['namespace'=>'UserApi','prefix' => 'user'],function () {

    Route::post('class_home_lists', 'ClassController@class_home');

    Route::post('class_home_info','ClassController@class_home_info');

    //课程列表
    Route::post('class_base_info','ClassController@class_base_info');

    Route::post('teacher_info','TeacherController@info');

    //课程搜索条件
    Route::post('class_where', 'ClassController@lists_where');

});

//会员端
Route::group(['namespace'=>'UserApi','prefix' => 'user','middleware' =>'user_check'],function (){

    //用戶預約
    Route::post('create_subscribe','UserSubscribeController@create_subscribe');
    //我的預約
    Route::post('my_subscribe','UserSubscribeController@my_subscribe');

    //改变预约状态
    Route::post('change_subscribe','UserSubscribeController@change_subscribe');

    //用户
    Route::post('user_info','UserController@user_info');

    //申请审核积分
    Route::post('apply_integral','UserIntegralController@apply_integral');
    //我的申请记录
    Route::post('my_integral','UserIntegralController@my_integral');

    //签到打卡
    Route::post('sign_train','UserTrainContoller@sign_train');
    //我的打卡 我的训练记录
    Route::post('user_train','UserTrainContoller@user_train');

    Route::post('upload_image','UploadController@upload_image');

});


